# Contributor: André Klitzing <aklitzing@gmail.com>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=pydiffx
pkgver=1.1
pkgrel=3
pkgdesc="Python Reader/Writer for DiffX Files"
url="https://diffx.org/pydiffx/"
# broken big-endian compares
arch="noarch !s390x"
license="MIT"
depends="python3 py3-six"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-kgb py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/p/pydiffx/pydiffx-$pkgver.tar.gz
	assertRaisesRegexp.patch
	"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
	rm -r "$pkgdir"/usr/lib/python3*/site-packages/pydiffx/tests
}

sha512sums="
9eb0565fb4e68f1a2e9a4e810a1132f9fa542a3c4d0a7431b9a9bedbdc5f630521bfa2da71c711a9f9be8d4dc7d900e765a9491281376b0b7e1bb40776a8ddda  pydiffx-1.1.tar.gz
6bc25cfdbde134cdbbfad00e5060d9b384ea2319f3f16ebc69d3bcb66951f269b805419a4b8e285a4e1bb5e92986f39e6d449e77f22258f81abc613665c58bfb  assertRaisesRegexp.patch
"
